import axios from '@/libs/api.request'

export const getCourseList = (seachParams) => {
  return axios.request({
    url: 'course',
    method: 'get',
    params: seachParams
  })
}

export const getCourse = (id) => {
  return axios.request({
    url: 'course/' + id,
    method: 'get'
  })
}

export const addCourse = (data) => {
  return axios.request({
    url: 'course',
    method: 'post',
    data: data
  })
}

export const updateCourse = (id, data) => {
  return axios.request({
    url: 'course/'+id,
    method: 'put',
    data: data
  })
}

export const deleteCourse = (id) => {
  return axios.request({
    url: 'course/'+id,
    method: 'delete'
  })
}
